//引入组件库
var do_Page = sm("do_Page");
var nf = sm("do_Notification");
var qqHttp = require("helper/http");
var userUrl = require("url/user");
var httpUrl = userUrl.url.shield.del;
//声明UI变量
var root=ui("$");  //$表示当前视图的根UI
var alayoutRoot=ui("alayoutRoot");
//设置数据绑定的映射关系
root.setMapping({
	"alayoutRoot.tag":"id",
	"do_ImageView_1.source":"shieldUserLogo",
	"do_Label_1.text":"shieldUserNick",
	"do_Label_2.text":"typeDesc"
});

ui("do_Button_del").on("touch",function(){
	nf.confirm("您确实要删除这条记录吗？", "删除", "确定", "取消", function(data, e) {
		if(data == 1){
			del();
		}
	})
})
function del(){
	var params = {
		id: alayoutRoot.tag
	};
	qqHttp.post(httpUrl, params, function(data) {
		nf.toast("删除成功");
		do_Page.fire("deleteShield",alayoutRoot.tag);
	})
}